package com.hema.auction.widget.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hema.auction.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * author by john
 */

public class FloatDetailPrice extends LinearLayout {


    @BindView(R.id.tv_float_now_price)
    TextView tvNowPrice;
    @BindView(R.id.tv_float_markt_price)
    TextView tvMarktPrice;
    @BindView(R.id.tv_float_time_tips)
    TextView tvTimeTips;
    @BindView(R.id.tv_float_time)
    TextView tvTime;

    public FloatDetailPrice(Context context) {
        super(context);
        init();
    }

    public FloatDetailPrice(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FloatDetailPrice(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private void init() {
        ButterKnife.bind(this, LayoutInflater.from(getContext()).inflate(R.layout.layout_commodity_detail_float_price, this));
    }


    public void setNowPrice(String nowPrice) {
        tvNowPrice.setText(nowPrice);
    }

    public String getNowPrice() {
        return tvNowPrice.getText().toString();
    }

    public void setMarktPrice(String marktPrice) {
        tvMarktPrice.setText(marktPrice);
    }

    public String getMarktPrice() {
        return tvMarktPrice.getText().toString();
    }

    public String getTime() {
        return tvTime.getText().toString();
    }

    public void setTime(String time) {
        tvTime.setText(time);
    }

    public void setAuctionEnd() {
        tvTimeTips.setText(getContext().getString(R.string.auction_end));
    }

    public void setAuctionStart() {
        tvTimeTips.setText(getContext().getString(R.string.distance_end));
    }


    @OnClick({})
    public void onClick(View v) {
    }


}
